#include<algorithm>
#include<fstream>
#include<functional>
#include<iostream>
#include<map>
#include<sstream>
#include<string>
#include<unordered_set>
#include<unordered_map>
#include"Configuration.h"
#include"DirScanner.hpp"
#include"RssReader.hpp"

using namespace std;

class WebPageLib
{
private:
       DirScanner& _dirScanner;//目录扫描类引用
       RssReader& _rssReader;

       std::vector<std::string> _files;//存放格式化后的xml文件
       std::unordered_map<int,std::pair<int,int>>
           _offsetLib;//网页偏移库
       std::unordered_map<string,vector<pair<int,double>>> _invert;
public:
       WebPageLib(DirScanner& dirScanner,RssReader& rssReader);
       ~WebPageLib();

       void createWebPageLib();//创建网页库
       void storeWebPagesFile();
       void storeOffsetFile();
       void storeInvertIndexFile();
       void store();
       void setInvertIndex();
};
